/*
 *  alias.h
 *  osnutshell
 *
 *  Created by Zachary  Heylmun on 3/28/10.
 *  Copyright 2010 University of Florida. All rights reserved.
 *
 */

#ifndef ALIAS_H
#define ALIAS_H

#include <algorithm>
#include <cctype>
#include <fstream>
#include <iostream>
#include <ios>
#include <map>
#include <stdexcept>
#include <string>
#include <vector>

#include "BuiltIn.h"
#include "Scanner.h"

namespace nutshell 
{
	class Alias: public BuiltIn
	{
	private:
		std::map<std::string, std::vector<std::string> > aliases;
		bool contains_loop(const std::string&);
		bool contains_loop_aux(std::string, std::map<std::string,bool>);
	public:
		Alias() {}
		~Alias() {}
		virtual void do_command(int, char**);
		bool is_alias( std::string );
		std::vector< std::string > expand_alias( std::string );
		void unalias(std::string, bool ask = true);
		void list_aliases();
	};
}


#endif
